import common
import unittest

class test_binds(common.TestCase):

    tables_to_drop = ('stest',)

    def test_bad_binds_in_9i(self):
        # this test from Christopher Jenkins, looking for bad binds in Oracle 9i
        c = self.c
        
        c.execute('create table stest (s char(10))')

        l1 = [(None,),("hello",),(None,)]
        l2 = [("",),("hello",),("",)]

        stmt = "insert into stest values(:1)"

        c.executemany(stmt, l1)
        c.executemany(stmt, l2)

        c.execute('select * from stest')

        self.assertEqual(
            c.fetchall(),
            [[None], ['hello     '], [None], [''], ['hello     '], [None]]
            )

if __name__ == '__main__':
    unittest.main()
